package com.dldata.devtools30.repository.api;



import com.dldata.devtools30.entity.DevtApiLogEntity;
import com.dldata.devtools30.entity.DevtApiTjoptEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;

/**
 * Created by ai on 2017/1/11.
 */
@Repository
public interface DevtApiLogEntityDao
        extends com.dldata.devtools30.repository.BaseRepository<DevtApiLogEntity,String>,
        JpaSpecificationExecutor<DevtApiLogEntity> {
    
    @Query("select d from DevtApiLogEntity d where cdate>=?2 and  cdate<?3 and (d.subid=?1 or subid in (select d.id from DevtApiSubEntity d where d.dm=?1 )) order by  d.id desc ")
    public List<DevtApiLogEntity> getApiLogList(String subid, java.sql.Date stdate , java.sql.Date enddate);
    
    @Query("select d from DevtApiLogEntity d where cdate>=?1 and  cdate<?2 order by  d.id desc ")
    public List<DevtApiLogEntity> getApiLogList(java.sql.Date stdate , java.sql.Date enddate);
}
